# $Id: PKGBUILD 81972 2013-01-05 07:30:40Z giovanni $
# Maintainer: Giovanni Scafora <giovanni@archlinux.org>
# Contributor: Jason Chu <jason@archlinux.org>

pkgname=usbview
pkgver=2.0
pkgrel=2
pkgdesc="Display the topology of devices on the USB bus"
arch=('i686' 'x86_64')
url="http://www.kroah.com/linux/usb/"
license=('GPL')
depends=('gtk3' 'desktop-file-utils')
makedepends=('pkg-config' 'gendesk')
install=${pkgname}.install
source=("http://www.kroah.com/linux/usb/${pkgname}-${pkgver}.tar.gz")
md5sums=('565f2e79f3924d14ab5b4d8aced557e5')

build() {
  cd "${srcdir}"
  gendesk -n
  sed -i "s:Application;:Application;System:g" "${srcdir}"/${pkgname}.desktop

  cd "${pkgname}-${pkgver}"

  ./configure --prefix=/usr \
              --sysconfdir=/etc \
              --localstatedir=/var
  make
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  make prefix="${pkgdir}/usr" \
       sysconfdir="${pkgdir}/etc" \
       localstatedir="${pkgdir}/var" install

  install -Dm0644 "${srcdir}"/${pkgname}.desktop \
    "${pkgdir}"/usr/share/applications/${pkgname}.desktop

  install -Dm0644 "${srcdir}"/${pkgname}-${pkgver}/usb_icon.xpm \
    "${pkgdir}"/usr/share/pixmaps/${pkgname}.xpm
}
